import { _decorator, Component, Node } from 'cc'
import { DirectionSubStateMachine } from '../../Base/DirectionSubStateMachine'
import { StateMachine } from '../../Base/StateMachine'
import { DIRECTION_ENUM } from '../../Enum'
import State from '../../Base/State'
const { ccclass, property } = _decorator

/**
 * Predefined variables
 * Name = AttackSubStateMachine
 * DateTime = Thu Jul 21 2022 14:02:00 GMT+0800 (中国标准时间)
 * Author = Zero_Y
 * FileBasename = AttackSubStateMachine.ts
 * FileBasenameNoExtension = AttackSubStateMachine
 * URL = db://assets/Scripts/WoodenSkeleton/AttackSubStateMachine.ts
 * ManualUrl = https://docs.cocos.com/creator/3.4/manual/zh/
 *
 */

const BASE_URL = 'texture/woodenskeleton/attack'
@ccclass('AttackSubStateMachine')
export class AttackSubStateMachine extends DirectionSubStateMachine {
  constructor(fsm: StateMachine) {
    super(fsm)
    // NPC攻击动画
    this.stateMachines.set(DIRECTION_ENUM.TOP, new State(fsm, `${BASE_URL}/top`))
    this.stateMachines.set(DIRECTION_ENUM.BOTTOM, new State(fsm, `${BASE_URL}/bottom`))
    this.stateMachines.set(DIRECTION_ENUM.LEFT, new State(fsm, `${BASE_URL}/left`))
    this.stateMachines.set(DIRECTION_ENUM.RIGHT, new State(fsm, `${BASE_URL}/right`))
  }
}
